<div class="form__wrapper">
  <div class="card attendee-fields pt-4">
    <div class="row column">
      <fieldset>
        <legend><%= t(".attendee_type") %></legend>
        <%= form.collection_radio_buttons(:existing_user, [[t(".non_user"), false], [t(".existing_user"), true]], :last, :first) %>
      </fieldset>
    </div>

    <div class="row column text-warning attendee-fields--new-user">
      <p><%= t(".invite_explanation") %></p>
    </div>

    <div class="row column cell attendee-fields--new-user">
      <%= form.text_field :name %>
    </div>
    <div class="row column cell attendee-fields--new-user">
      <%= form.text_field :email %>
    </div>

    <div class="row column cell attendee-fields--user-picker">
        <% prompt_options = { url: decidim_admin.users_organization_url, placeholder: t(".select_user") } %>
        <%= form.autocomplete_select(:user_id, form.object.user.presence, { multiple: false, class: "autocomplete-field--results-inline" }, prompt_options) do |user|
          { value: user.id, label: "#{user.name} (@#{user.nickname})" }
        end %>
    </div>

    <div class="row column cell">
      <%= form.select :registration_type_id,
                      options_for_select(@form.registration_types_for_select),
                      { include_blank: false },
                      { multiple: false, class: "chosen-select" } %>
    </div>
  </div>
</div>
<%= append_javascript_pack_tag "decidim_conferences_admin" %>
